package org.chickymate.scrumboard.client.view;

import org.chickymate.scrumboard.client.presenter.CreateBoardPresenter;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class CreateBoardView extends Composite implements CreateBoardPresenter.Display {
	
	private final TextBox projectName;
	private final FlexTable boardTable;
	private final Button saveButton;
	private final Button cancelButton;
	
	public CreateBoardView(){
		this.boardTable = new FlexTable();
		
		this.initWidget(this.boardTable);
		this.projectName = new TextBox();
		this.saveButton = new Button("create");
		this.cancelButton = new Button("cancel");
		this.boardTable.add(projectName);
		this.boardTable.add(saveButton);
		this.boardTable.add(cancelButton);
	}

	@Override
	public Widget asWidget() {
		return this;
	}

	@Override
	public HasValue<String> getBoardName() {
		return this.projectName;
	}

	@Override
	public HasClickHandlers getCancelButton() {
		return this.cancelButton;
	}

	@Override
	public HasClickHandlers getSaveButton() {
		return this.saveButton;
	}

}
